<template>
    <section>
        <div class="app-container is-form">
            <el-form label-width="125px" v-loading="loading" >
                <el-row class="createPost-main-container">
                    <el-form-item label="姓名" required >
                        <el-input v-model="form.name" style="width:300px;"></el-input>
                    </el-form-item>
                    <el-form-item label="性别" required >
                        <el-input v-model="form.sex" style="width:300px;"></el-input>
                    </el-form-item>
                    <el-form-item label="年龄" required >
                        <el-input v-model="form.age" style="width:300px;"></el-input>
                    </el-form-item>
                    <el-form-item label="年级" required >
                        <el-input v-model="form.grade" style="width:300px;"></el-input>
                    </el-form-item>
                    <el-form-item label="班级" required >
                        <el-input v-model="form.classRoom" style="width:300px;"></el-input>
                    </el-form-item>
                </el-row>
            </el-form>
            <el-button v-loading="isSubmitLoading" style="margin-left: 10px;" type="success" @click="submit">保存 </el-button>
        </div>
    </section>
</template>
<script>
    import StudentDao from '@/api/StudentDao';
    export default {
        name:"DemoDetail",
        components: {  },
        data() {
            return{
                pageTitle: '新增DemoDetail',
                loading: false,
                isSubmitLoading: false,
                form: {
                    name:'',
                    sex:'',
                    age:'',
                    grade:'',
                    classRoom:'',
                },
            }
        },
        validators: {
            // 'form.name': function(value) {
            //     return this.validator.value(value).required('请填写姓名').regex('^[a-zA-Z\u4e00-\u9fa5]{2,40}$','用户名为2-12位字母或汉字');
            // },
        },
        methods: {
            async submit() {

            },
            async loadModel(){
                let id  =   this.$route.query.id || 0
                console.log('[id]',id)
                if(id ){

                }
            },
        },
        mounted() {
            this.loadModel()
        }
    }
</script>
